Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve release caching and prevent download loops #307

Merged
merged 11 commits into from
Apr 4, 2022

Conversation

felddy
Copy link
Owner

@felddy felddy commented Apr 4, 2022

🗣 Description

This PR addresses the concerns documented in issue #306

It seems some misconfigured clients can get into tight download loops that cause them to generate great amounts of network traffic to the Foundry release S3 bucket.

It makes the following changes:

  • enabling caching of release download by default. Previously CONTAINER_CACHE would need to be set to enable caching.
  • if release caching is disabled, and the container downloaded a release, it will now sleep forever instead of exiting if the node server exits. This prevents looping.
  • all network requests now have a more detailed User-Agent header that contains the name of the container and its version in the comments. e.g.; curl/7.80.0 (felddy/foundryvtt:9.255.0). This applies to both curl and node-fetch requests.
  • updates to the documentation of CONTAINER_CACHE
  • adding the --verbose flag to curl invocations when CONTAINER_VERBOSE is set.
  • improved logging of exit codes, and the aforementioned sleep loop.

💭 Motivation and Context

These changes attempt to address the issue document in #306

Hopefully this will significantly lessen the network load on Foundry's release distribution bucket across the board, and specifically for containers that are crashing and re-downloading.

🧪 Testing

Tested locally and in CI.

✅ Checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow project standards.
  • All relevant repo and/or project documentation has been updated to reflect
    the changes in this PR.
  • All new and existing tests pass.

@felddy felddy added bug labels Apr 4, 2022
@felddy felddy self-assigned this Apr 4, 2022
@felddy felddy merged commit 2ff60c4 into develop Apr 4, 2022
@felddy felddy deleted the improvement/cache_by_default branch April 4, 2022 22:34
@felddy felddy mentioned this pull request Apr 5, 2022
7 tasks
Sallenmoore pushed a commit to Sallenmoore/foundryvtt-docker that referenced this pull request Jun 18, 2023
Improve release caching and prevent download loops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant